<!DOCTYPE htmlPUBLIC "-//W3C//DTDXHTML1.0Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head><title>HelloWorld RFC4627 JSON-RPC test based on JavaScript</title>
  <script type="text/javascript" src="/js/prototype.js"></script>
  <script type="text/javascript" src="/js/json.js"></script>
  <script type="text/javascript" src="/js/jsonrpc.js"></script>

  <script
      src="https://api-secure.recaptcha.net/challenge?k=6LezHAAAAAAAADqVjseQ3ctG3ocfQs2Elo1FTa_a&amp;ajax=1&amp;cachestop=0.912535794334185"
      type="text/javascript">
  </script>
  <style type="text/css">
    .recaptcha_is_showing_audio .recaptcha_only_if_image, .recaptcha_isnot_showing_audio .recaptcha_only_if_audio, .recaptcha_had_incorrect_sol .recaptcha_only_if_no_incorrect_sol, .recaptcha_nothad_incorrect_sol .recaptcha_only_if_incorrect_sol {
      display: none !important
    }
  </style>
</head>
<body>
<h1>HelloWorld RFC4627 JSON-RPC test based on JavaScript</h1>

<div id="container"><p>This is an example</p></div>

<script type="text/javascript">
  //<![CDATA[
  function log(result, error) {
    if (!error) {
      $("container").update(JSON.stringify(result) + "\n");
    } else {
      $("container").update("ERROR <pre>" + JSON.stringify(result).replace(/(\\n)+/g, "<br/>") + "</pre>\n");
    }
  }
  function testMain(name) {
    var testService = new JsonRpcTransaction("/json_rpc/current_date", "current_date_proc", [name]);
    testService.addCallback(log);
    testService.addErrorCallback(log);
    //testService.sendRequest();
  }
  //]]>
</script>

<form action="index.html" onsubmit="testMain($(name).value); return false">
  What is your name?
  <input id="name" type="text" size="10" value="&#280;dward &#260;cki"/>
  &nbsp;<span style="font-size:x-small;">press enter</span>
</form>

<script type="text/javascript">
  Field.focus($("name"));
</script>
<table>
<tr class="security_check">
  <td class="label">
    Security Check:
  </td>
  <td>
    <div class="field_error" id="captcha_response_error" style="display: none;">
      This field is required.
    </div>
    <div id="captcha" class="captcha">
      <input id="captcha_challenge_code" name="captcha_challenge_code"
             value="1200933775-86a7d666e59e2dac584a6708592dc067" type="hidden">

      <div class="captcha_challenge">
        <div id="recaptcha_scripts" style="display: none;">
        </div>
        <div class="recaptcha_text">
          Enter
          <strong>
            both
          </strong>
          words below, separated by a
          <strong>
            space.
          </strong>
          <small>
            <a href="#" id="captcha_whatsthis" onclick="captcha_whatsthis(this); return false">
              What's This?
            </a>
          </small>
          <br>
          Can't read this?
          <a href="#" id="recaptcha_reload_btn" onclick="Recaptcha.reload(); return false" tabindex="-1">
            Try another.
          </a>

          <div style="width: 300px; height: 57px;" id="recaptcha_image">
            <img style="display: block;"
                 src="https://api-secure.recaptcha.net/image?c=02c-P61E0HijTPBmMhWRmMdsuCFtS8WCe-R0zOtOW_6UXpRmJmZBDn6v6gOOvAnE9xfyUQ3_3HwUjrwuZoa6we7XHFdsejhNrSjMA8MF_qUYmivQMfUvvpFUV7cEHq1BytUeNF94lzn41dcff8PI5rKvuSe_WVZJRdDp9B9-cgMqdvww1JAwMD"
                 height="57" width="300">
          </div>
<span id="recaptcha_play_audio">
</span>

          <div class="audiocaptcha">
            <a href="#" class="recaptcha_only_if_audio" onclick="Recaptcha.switch_type('image'); return false"
               tabindex="-1">
              Back to text.
            </a>
            <br>
            <a href="#" class="recaptcha_only_if_image" onclick="Recaptcha.switch_type('audio'); return false"
               tabindex="-1">
              Try an audio captcha
            </a>
          </div>
        </div>
        <script type="text/javascript">
          setTimeout(function() {
            Recaptcha.create("6LezHAAAAAAAADqVjseQ3ctG3ocfQs2Elo1FTa_a", "recaptchadiv_view", {
              theme: "custom",
              callback: Recaptcha.focus_response_field
            });
          }, 0);

        </script>
      </div>
      <div class="captcha_input">
        <label>
          Text in the box:
        </label>
        <input
            value="02c-P61E0HijTPBmMhWRmMdsuCFtS8WCe-R0zOtOW_6UXpRmJmZBDn6v6gOOvAnE9xfyUQ3_3HwUjrwuZoa6we7XHFdsejhNrSjMA8MF_qUYmivQMfUvvpFUV7cEHq1BytUeNF94lzn41dcff8PI5rKvuSe_WVZJRdDp9B9-cgMqdvww1JAwMD"
            id="recaptcha_challenge_field" name="recaptcha_challenge_field" style="display: none;" autocomplete="off"
            type="password">
        <input autocomplete="off" name="captcha_response" id="captcha_response" type="text">
      </div>
    </div>
  </td>
</tr>
</table>  
</body>
</html>